package cn.jetpiece.cloud.joss.api.object.model.params;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author XuJZ
 * @since 2020/9/10
 */
@Data
@ApiModel
public class MultiPartUploadObject {


    /**
     * 桶
     */
    @ApiModelProperty(value = "桶")
    private String bucketName;


    /**
     * 上传ID
     */
    @NotNull(message = "上传ID不能为空")
    @ApiModelProperty(value = "上传ID", required = true)
    private String uploadId;

    /**
     * 分片号
     */
    @NotNull(message = "分片号不能为空")
    @Min(value = 1, message = "范围是1~10000")
    @Max(value = 10000, message = "范围是1~10000")
    @ApiModelProperty(value = "分片号，范围是1~10000", required = true)
    private Integer partNumber;

    /**
     * 分片大小
     */
    @NotNull(message = "分片大小不能为空")
    @Min(value = 100 * 1024, message = "最小100KB")
    @Max(value = 10 * 1025 * 1024, message = "最大10M")
    @ApiModelProperty(value = "分片大小，单位：字节，最小100KB，最大10M", required = true)
    private Long partSize;

    /**
     * 偏移量
     */
    @NotNull(message = "偏移量不能为空")
    @ApiModelProperty(value = "偏移量，首个分片为0", required = true)
    private Long offset;

    /**
     * 分片MD5值
     */
    @NotBlank(message = "分片MD5值不能为空")
    @ApiModelProperty(value = "分片MD5值", required = true)
    private String contentMd5;

}
